home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / util / dir / GetType.lha / GetType1.12 / GT.doc < prev    next >
Text File  |  1999-02-18  |  20KB  |  491 lines

  1.  
  2.  +--------------------------------------------------------------------------+
  3.  |                    Documentation for GetType 1.12                        |
  4.  |                                                                          |
  5.  |     Program & related files are copyright © 1997-1999 Andrew Bell.       |
  6.  +--------------------------------------------------------------------------+
  7.  
  8.  ----------------------------------------------------------------------------
  9.  DISCLAIMER
  10.  ----------------------------------------------------------------------------
  11.  
  12.  BY USING THIS PROGRAM THE USER ACCEPTS FULL LIABILITY FOR ANY DAMAGE THAT
  13.  COULD POSSIBLY BE CAUSED BY ITS USAGE OR MISUSE. THE AUTHOR OF THIS SOFTWARE
  14.  CANNOT BE HELD RESPONSIBLE FOR ANY DAMAGE.
  15.  
  16.  THIS PROGRAM IS PROVIDED AS-IS. USE THIS PROGRAM AT YOUR OWN RISK.
  17.  
  18.  (After all, you did get it for free!)
  19.  
  20.  ----------------------------------------------------------------------------
  21.  DISTRIBUTION
  22.  ----------------------------------------------------------------------------
  23.  
  24.  IT IS PROHIBITED TO DISTRIBUTE GETTYPE WITHOUT THE FOLLOWING FILES:
  25.  
  26.  GetType/GT
  27.  GetType/GT.doc
  28.  GetType/GT.readme
  29.  GetType/GT_Types.txt
  30.  GetType/Libs/Idm.library
  31.  GetType/Libs/Idm.library.readme
  32.  GetType/Libs/FileID.library
  33.  
  34.  GETTYPE IS FREE, AND NO PROFIT SHOULD BE MADE FROM DISTRIBUTING IT.
  35.  
  36.  ----------------------------------------------------------------------------
  37.  OVERVIEW
  38.  ----------------------------------------------------------------------------
  39.  
  40.  GetType is a CLI/Shell program that enables the user to identify files via
  41.  a Shell/DOS prompt. It requires an 020 processor or better, and at least
  42.  version 39 of the Amiga operation system. It also needs Idm.library version
  43.  1 or later.
  44.  
  45.  The actual identification work is done by Idm.library (and FileID.library),
  46.  currently this library recognizes over 1100 filetypes.
  47.  
  48.  I recommend using an 030 CPU or better.
  49.  
  50.  ----------------------------------------------------------------------------
  51.  INSTALLATION
  52.  ----------------------------------------------------------------------------
  53.  
  54.  Simply copy the executable (GT) to the C: drawer, and Idm.library to the
  55.  LIBS: drawer. Copy FileID.library to LIBS: also, but check to see if you
  56.  already have a higher version already installed, if so you don't need to
  57.  install it.
  58.  
  59.  ----------------------------------------------------------------------------
  60.  PROGRAM USAGE
  61.  ----------------------------------------------------------------------------
  62.  
  63.  Once installation has been completed, you can now start the program. Simply
  64.  type GT at the Shell/DOS prompt to start it.
  65.  
  66.  The command line is as follows:
  67.  
  68.  DIR/M
  69.  
  70.   Use this parameter to provide the locations of the files and dirs to
  71.   scan.
  72.  
  73.  ALL/S
  74.  
  75.   Enter into sub-directories. When using this option the output can be a
  76.   little confusing on big HDs with deep directory trees.
  77.  
  78.   If you don't like the output, consider using the LFMT parameter. The
  79.   ALL option is not really designed to be used with the default output.
  80.  
  81.  HL_U/S
  82.  
  83.   Highlight unknown files.
  84.  
  85.  HL_K/S
  86.  
  87.   Highlight known files.
  88.  
  89.  HELP/S
  90.  
  91.   A simple help page giving details on the parameters.
  92.  
  93.  INFO/S
  94.  
  95.   More information on the currently installed version of Idm.library.
  96.  
  97.  TYPES/S
  98.  
  99.   Display a (very long) list of all the filetypes known to the currently
  100.   installed version of Idm.library. If this list is too long, then press
  101.   CONTROL+C to break.
  102.  
  103.  IDPAT/K
  104.  
  105.   An AmigaDOS pattern/wildcard string, used for finding certain filetypes.
  106.   For example, if you wanted to view only the filetypes recognized by
  107.   FileID.library then type something similar to this:
  108.  
  109.   GT <PutPathHere> <PutOptionsHere> UFID IDPAT=FID:#?
  110.  
  111.   Note: Uppercase and lowercase are both treated as the same.
  112.  
  113.  DGEN/S
  114.  
  115.   Display general filetypes (Executable/Data) instead of a question mark '?'.
  116.  
  117.  SC=SETCOMMENT/S
  118.  
  119.   Set file's comment with identification string. Don't use this feature if
  120.   you place great value on your file comments.
  121.  
  122.  SI=SHOWICONS/S
  123.  
  124.   Show #?.info files. By default GetType does not show icon files.
  125.  
  126.  IOLEN/N
  127.  
  128.   Specify a new read length. This value sets the amount of bytes to be loaded
  129.   off the start of each file, while scanning. Idm.library requires GT to load
  130.   about 2Kb from the start of each file in order to identify it. By using
  131.   this option you can force GT to load a smaller amount of bytes from each
  132.   file, doing this will result in less files being identified but a faster
  133.   performance.
  134.  
  135.   Any number below 4 will become 4.
  136.  
  137.   NOTE: If you use the UFID option the IOLEN parameter will be forced to at
  138.         least 1200 bytes. This is required because FileID.library needs a
  139.         minimum of 1200 bytes to be loaded off the start of each file, to
  140.         ensure a proper identification check.
  141.  
  142.  UFID=USEFILEID/S 
  143.  
  144.   Tells GT to use FileID.library for any unknown filetype encountered. v8+ of
  145.   this library is required. Any IDs made by this library will have a 'FID:'
  146.   prefix for clarity (except for LFMT's %2 code).
  147.  
  148.  LFMT/K
  149.  
  150.   Perhaps one of GTs more powerful parameters, using this parameter allows
  151.   the user to create simple script/batch files or configure the output. At
  152.   the moment the default output is very ugly, so you might want to consider
  153.   using this option :) especially if you are using DOpus, DirWork, etc.
  154.  
  155.   This parameter is similar to the LIST command's LFORMAT parameter. The user
  156.   will pass a formatted string and GT will parse it with the desired
  157.   information.
  158.  
  159.   So for example if we wanted to delete all StoneCracker compressed files
  160.   in the C: drawer, we could type the following at a Shell prompt:
  161.  
  162.   GT c: all lfmt="delete %p%n FORCE" idpat=#?stc#? >ram:tempscriptfile
  163.   execute ram:tempscriptfile
  164.   delete ram:tempscriptfile
  165.  
  166.   In order to build the output string via the LFMT parameter we need
  167.   to know what format components codes are available:
  168.  
  169.   %% = insert a literal % charactor
  170.   %P = insert full path (same as %p%n, eg: dh0:mydrawer/myfile)
  171.   %p = insert path string (eg: dh0:mydrawer/)
  172.   %n = insert filename string (eg: myfile)
  173.   %l = insert entry type string (eg: F, LF, PF, etc.)
  174.   %s = insert size in bytes string (eg: 153432)
  175.   %S = insert size string (rounds off lengths to K, MB, GB, etc.)
  176.   %i = insert primary identifcation string.
  177.   %1 = insert identification result of Idm.library
  178.   %2 = insert identification result of FileID.library (without FID: prefix)
  179.   %3 = insert identification result of GT name matching.
  180.   %c = insert file comment.
  181.   %b = insert the amount of blocks the file takes up.
  182.  
  183.   If you insert a '-' and THREE decimal digits immediately after the '%' you
  184.   can specify the width in charactors you wish the string to fill. The
  185.   remainder of the string will be padded with spaces. This will let you
  186.   create more readable strings, but is not much use when creating script
  187.   files (as shown above).
  188.  
  189.   Remember when using the '-' symbol that you MUST put three decimal digits
  190.   after it. So NEVER use %-8n, use %-008n instead.
  191.  
  192.   If you want a full path use %P and not %p%n, remember these format codes
  193.   are case sensitive. I hear you ask: What is the point of having %P when
  194.   %p%n does the same job? Well the answer is: %P works better with the
  195.   '-' symbol. Simple.
  196.  
  197.   If the string is bigger than the number you pass with the '-' symbol, then
  198.   the bounds will be broken. If you want to limit the amount of charactors
  199.   inserted, then you can append a '.' (period) followed by a THREE digit
  200.   number that will specify the maximum allowed charactors.
  201.  
  202.   It you need spaces in you LFMT string remember to enclose it in "double
  203.   quotes" (eg: LFMT="File %n is %i").
  204.  
  205.   If all this seems complicated, thats because it is :) This parameter is
  206.   for the advanced Amiga user only.
  207.  
  208.   Believe it or not, but you can create a more readable GT output by using:
  209.  
  210.   gt dh0: all lfmt="%-040.040P %-028.028i %s" dgen
  211.   
  212.  FIDTYPES/S
  213.  
  214.   Display a (very long) list of all the filetypes known to the currently
  215.   installed version of FileID.library. If this list is too long, then press
  216.   CONTROL+C to break.
  217.  
  218.  NNM=NONAMEMATCH/S
  219.  
  220.   Since version 1.12, GT now attempts to identify files via their names.
  221.   Passing this option will force GT not to do any name matching. For
  222.   example, GT is able to recognize a standard Amiga run-time by checking
  223.   to see if the name matches *.library. The NONAMEMATCH option will disable
  224.   this method of identification.
  225.  
  226.  NAMETYPES/S
  227.  
  228.   Display all known name prefixes/extensions (aka name types) types known
  229.   internally to GetType. Since v1.12 GT has its own internal database of
  230.   common filename prefixes/extensions, using this, GT can dertermine basic
  231.   filetypes. Passing this option GT will enable you to see all known
  232.   prefixes/extensions known to GT.
  233.  
  234.  REQ/S
  235.  
  236.   This will enable you to force the output to a requester instead of the
  237.   Shell window. To use this option you must specify the LFMT parameter.
  238.   The LFMT parameter is used to construct the body text of the requester.
  239.   If you want a newline inside the requester use a *n or a \n inside the
  240.   LFMT string.
  241.  
  242.   For example: gt c: LFMT="%P\n\nIdentification is:\n\n%i" REQ DGEN
  243.  
  244.   Notes:
  245.  
  246.   1. Currently the requester to opened on the default public screen.
  247.   2. Each line is centred, there is currently *NO* way around this!
  248.  
  249.   Some people may prefer this option, especially if DOpus or DirWork is
  250.   being used.
  251.  
  252.  ----------------------------------------------------------------------------
  253.  INFORMATION & EXTRA NOTES
  254.  ----------------------------------------------------------------------------
  255.  
  256.  GT (by default) does not display icon files, use the SI=SHOWICONS/S option
  257.  to override this. If you notice some short pauses while running GT, this is
  258.  normally the icon files (#?.info) being skipped.
  259.  
  260.  For each release of Idm.library the IOLEN can change. For Idm.library v1.85
  261.  it stands at 1470 bytes. This might seem like a lot but since harddrives are
  262.  getting faster these days, who cares?
  263.  
  264.  The output of GT will be faster if a console patch like KingCON is not used.
  265.  (KingCON tends to slow down while updating its scroller gadget)
  266.  
  267.  If scanning big harddrives I recommend you redirect the output of GT, for
  268.  example: GT dh0: all >ram:GT_output.txt, doing this will make life faster :)
  269.  It will also give you a big output file! So make sure you have a lot of
  270.  spare storage space in the destination drawer.
  271.  
  272.  ----------------------------------------------------------------------------
  273.  THE OUTPUT
  274.  ----------------------------------------------------------------------------
  275.  
  276.  Here is an example of GetTypes output in Shell window:
  277.  
  278.  Store:Visual/
  279.  
  280.  Spin.IFF                   - IFF ILBM picture                 - F      5420
  281.  test1.anim8L               - IFF Animation file               - F     13080
  282.  test1.anim5                - IFF Animation file               - F      9258
  283.  XenonII_sprites.ilbm       - IFF ILBM picture                 - F      9110
  284.  Monsters of Terror         - IFF ILBM picture                 - F     33068
  285.  walkman                    - IFF ILBM picture                 - F     18554
  286.  SampleFont_EMCVol8.ilbm    - IFF ILBM picture                 - F     11570
  287.  samplegfx01.ilbm           - IFF ILBM picture                 - F     32220
  288.  
  289.  (END OF DIR)
  290.  
  291.  The output is divided into four sections these are:
  292.  
  293.  1.       File name - Name of the file processed.
  294.  2.  Identification - Identification of the file.
  295.  3. File entry type - This will be one of the following:
  296.  
  297.                       RT   =       ST_ROOT
  298.                       UD   =       ST_USERDIR
  299.                       SL   =       ST_SOFTLINK
  300.                       LD   =       ST_LINKDIR
  301.                       F    =       ST_FILE
  302.                       LF   =       ST_LINKFILE
  303.                       PF   =       ST_PIPEFILE
  304.                       ??   =       Unknown type
  305.  
  306.                       RT, UD, SL, LD will not appear in this version of GT.
  307.  
  308.  4.     File length - Length of the file in bytes
  309.  
  310.  
  311.  ----------------------------------------------------------------------------
  312.  HOW GETTYPE WORKS
  313.  ----------------------------------------------------------------------------
  314.  
  315.  GetType uses a standard Amiga run-time library known as Idm.library, (short
  316.  for IDentification Master). This library holds the actual information
  317.  required by GT to determine a file's type.
  318.  
  319.  When you run GT, GT loads Idm.library into memory. GT then scans each file
  320.  in the specified directory and loads a certain amount of bytes off every
  321.  one it encounters. It then passes this data to Idm.library which then
  322.  attempts to identify the file via a process called DNA (for lack of a better
  323.  word) matching.
  324.  
  325.  Most data files produced by applications normally contain some sort of an ID
  326.  string, for example an OctaMED module would contain the one of the following
  327.  DNA strings at offset 0 into the file: MMD0, MMD1, MMD2 or MMD3. Idm.library
  328.  contains many such DNA strings, each DNA string has a description associated
  329.  with it, this is what you see if Idm.library is able to match a DNA string.
  330.  
  331.  But a major problem with this method is, there's a very high rate of
  332.  incorrect matches! Say for example you create a text file and at the VERY
  333.  beginning (that means no spaces or newlines) of this file you typed
  334.  'AMOS Basic V1.00' (must be exactly as you see it here without the quotes!)
  335.  Idm.library would pick this up as an AMOS source code file when you scan
  336.  the directory that this text file resides in with GT. But we know that this
  337.  is just a simple text file. So the user (thats you!) must use his or her's
  338.  common sense to determine what GT matches are correct and what matches are
  339.  not correct.
  340.  
  341.  ----------------------------------------------------------------------------
  342.  COPYRIGHT
  343.  ----------------------------------------------------------------------------
  344.  
  345.  GetType is copyright © 1999 Andrew Bell. This software is FREEWARE.
  346.  
  347.  Commercial use of this program (and related files) is prohibited.
  348.  
  349.  FileID.library is copyright © 1998 Oliver Lange (BLOODROCK). Full package
  350.  can be found on Aminet: utils/libs dir.
  351.  
  352.  ----------------------------------------------------------------------------
  353.  PROGRAM HISTORY
  354.  ----------------------------------------------------------------------------
  355.  
  356.  History for GT versions 1.0-1.9 not documented, early test versions.
  357.  
  358.  1.10 (31.Jan.1999)
  359.  
  360.   o First public release via Aminet.
  361.  
  362.  1.11 (07.Feb.1999)
  363.  
  364.   o Idm.library 1.19 had a bug in it that stop it from working with OS40
  365.     (WB3.1) or greater. This was a very stupid bug. Delete this version if
  366.     you encounter it.
  367.   o Some minor changes made to the main program.
  368.   o Cleaned up the document, looks nicer :-)
  369.   o GT now shows the amount of files hidden from view.
  370.   o Removed tabs from help page.
  371.   o Added LFMT parameter.
  372.   o Now includes version 8 of FileID.library. Thanks Darek!
  373.   o Add FIDTYPES options.
  374.   o The help page stated in 1.10 that GT required Idm.library version 0,
  375.     this is wrong it should have been version 1.
  376.  
  377.  1.12 (18.Feb.1999)
  378.  
  379.   o GT is now able to determine a file's type via its filename.
  380.   o Added NNM=NONAMEMATCH/S parameter.
  381.   o Added NAMETYPES/S parameter.
  382.   o Extended LFMT parameter, added %1, %2 and %3 format codes.
  383.   o For completeness I added support for C style newlines \n in the LFMT
  384.     parameter.
  385.   o The output of GT can now be forced to a WB requester by using the
  386.     REQ/S parameter.
  387.   o More minor changes.
  388.   o GT has more tolerance now when it comes to errors. It won't quit
  389.     on the first error it encounters, instead it will attempt to
  390.     continue with the scan.
  391.   o You can now pass more then one file/dir name to GT in a single command
  392.     line. This makes GT more powerful when used with DOpus or DirWork.
  393.   o Extended the LFMT parameter by adding the %c format code. This will
  394.     enable you to insert file comments into the output.
  395.   o Also added the %b code to the LFMT parameter, this enables the user
  396.     to insert the amount of blocks a file takes up.
  397.   o For convenience, I added GT_Types.txt to the archive.
  398.  
  399.  ----------------------------------------------------------------------------
  400.  ADDITION INFORMATION
  401.  ----------------------------------------------------------------------------
  402.  
  403.  GetType is not pure nor re-entrant. So don't even think about making it
  404.  resident. Maybe future versions will support this, but this one does not,
  405.  because generating such code makes the executable bigger (Well, using my
  406.  methods anyway!).
  407.  
  408.  But whats the point in making programs resident these days when HDs are
  409.  so fast?
  410.  
  411.  ----------------------------------------------------------------------------
  412.  TODO
  413.  ----------------------------------------------------------------------------
  414.  
  415.  AmigaGuide / HTML documentation!
  416.  
  417.  Release the developer files for Idm.library to the public, if there is
  418.  enough demand via e-mail, I will do so.
  419.  
  420.  Maybe an installer script, but the package is still small.
  421.  
  422.  Config file, so the user does not have to type the same parameters at the
  423.  Shell prompt every time when starting GT.
  424.  
  425.  Check for viruses, I might use xvs.library for this.
  426.  
  427.  Add a format code to the LFMT parameter that will enable the user to insert
  428.  the file's date into the output string.
  429.  
  430.  Find a beta tester with a MC68060 :)
  431.  
  432.  ----------------------------------------------------------------------------
  433.  INFORMATION
  434.  ----------------------------------------------------------------------------
  435.  
  436.  GT was developed in C and Idm.library was developed in assembly.
  437.  
  438.  Source code for GT is 1600+ lines.
  439.  Source code for Idm.library is 2100+ lines.
  440.  
  441.  GT and Idm.library were developed on:
  442.  
  443.  A1200 - Blizzard 1230-IV (030 @ 50 Mhz / NOFPU / 32 MEG FAST),
  444.          2.1GB HD, Sony 4x speed CD-ROM via Classic Squirrel.
  445.  
  446.  I have been working on Idm's filetype database since 1995. I originally
  447.  create a filetype program in AMOS, then I decided to port it's database
  448.  to assembly. Idm.library was born in mid-96 and then got a total rewite
  449.  in 97. Hundreds of my own personal programs use Idm.library.
  450.  
  451.  GetType was born in late 1997, after creating the C developer files for
  452.  Idm.library I needed a program to test them, because all of my programs
  453.  prior to GT that called Idm.library were assembly. At this time I was
  454.  also studying for a software production course and writing this program
  455.  was a good opportunity to polish up on my C coding skills.
  456.  
  457.  ----------------------------------------------------------------------------
  458.  THANKS
  459.  ----------------------------------------------------------------------------
  460.  
  461.  Oliver Lange (aka BLOODROCK) for creating FileID.library. 
  462.  
  463.  Dariusz Gac for helping me solve the problems with v1.10 and for giving me
  464.  the idea for the LFMT parameter. Also, sorry for spelling your name wrong
  465.  in the 1.11 docs :)
  466.  
  467.  Rick Hodger for helping me test GT and his bug reports.
  468.  
  469.  Thanks to all of those people who bothered to send report bugs and offered
  470.  suggestions.
  471.  
  472.  <--- your name could be here :) --->
  473.  
  474.  ----------------------------------------------------------------------------
  475.  THE AUTHOR
  476.  ----------------------------------------------------------------------------
  477.  
  478.  send info, filetypes, bug reports, ideas, suggestions, anything, etc. too:
  479.  
  480.                                 Andrew Bell
  481.  
  482.                         andrew@ab2000.prestel.co.uk
  483.  
  484.             or failing that, you could try my backup account :)
  485.  
  486.                        andrew@ab2000.freeserve.co.uk
  487.  
  488.                    No e-mails greater than 100Kb please.
  489.  
  490.                 (remember to put 'GetType' in the subject)
  491.